package cn.jjxx.modules.activiti.listener;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

import cn.jjxx.core.utils.SpringContextHolder;
import cn.jjxx.modules.activiti.controller.ActivitiFlowService;

/**
 * @Title: AutoCompleteListener.java .<br>
 * @Package cn.jjxx.modules.activiti.listener .<br>
 * @Description: 党没有处理人时,自动完成任务 .<br>
 * @author 郑成功 .<br>
 * @email a876459952@qq.com .<br>
 * @date 2018-9-30 上午10:33:05.<br>
 * @version V1.0.<br>
 */
public class AutoCompleteListener implements TaskListener{

	private static final long serialVersionUID = -6550633456955697262L;

	@Override
	public void notify(DelegateTask delegateTask) {
		String taskId = delegateTask.getId();
		String assignee = delegateTask.getAssignee();
		if(assignee==null){
			SpringContextHolder.getBean(ActivitiFlowService.class).AutoComplate(taskId);
		}
	}

}
